package asia.myjhotel.xiaozhiagent.assistant;


import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.V;
import dev.langchain4j.service.spring.AiService;

import static dev.langchain4j.service.spring.AiServiceWiringMode.EXPLICIT;

/**
 * 隔离聊天记忆 AI service
 */
@AiService(
        wiringMode = EXPLICIT,
        chatMemory = "chatMemory",
        chatMemoryProvider = "chatMemoryProvider",
        chatModel = "qwenChatModel",
        tools = "calculatorTools" //配置tools

)
public interface SeprateMemoryChatAssistant {

    /**
     * 分离聊天记录
     *
     * @param memoryId    聊天id
     * @param userMessage 用户消息
     * @return
     */
    //添加对话系统角色 系统消息提示词
    //@SystemMessage("你是我的好朋友，请用东北话回答问题。今天是{{current_date}}")
    //@SystemMessage` 注解还可以从资源中加载提示模板：
    @SystemMessage(fromResource = "my-prompt-template.txt")
    String chat(@MemoryId int memoryId, @UserMessage String userMessage);


    @UserMessage(value = "你是我的好朋友，请用粤语回答问题。{{userMessage}}")
    String chat2(@MemoryId int memoryId, @V("userMessage") String userMessage);

    @SystemMessage(fromResource = "my-prompt-template3.txt")
    String chat3(
            @MemoryId int memoryId,
            @UserMessage String userMessage,
            @V("username") String username,
            @V("age") int age
    );
}
